import { pubRequire } from '@utils/public.js'
// 赠课商品活动列表
export function getGivingCoursesList(obj, sucBack, errBack) {
  pubRequire('get', '/giving-courses', obj, sucBack, errBack)
}
// 校验商品活动名称
export function validatorActivityName(obj, sucBack, errBack) {
  pubRequire('get', '/giving-courses/verifications', obj, sucBack, errBack)
}
// 根据课程名称查询课程信息列表
export function getCourseList(params, obj, sucBack, errBack) {
  pubRequire('get', `/courses/type/${params}`, obj, sucBack, errBack)
}
// 根据商品名称-编号查询商品
export function getGoodsList(obj, sucBack, errBack) {
  pubRequire('get', '/goods', obj, sucBack, errBack)
}
// 新增赠课
export function addGivingCourses(obj, sucBack, errBack) {
  pubRequire('post', '/giving-courses/activity', obj, sucBack, errBack)
}
// 编辑赠课
export function editGivingCourses(obj, sucBack, errBack) {
  pubRequire('put', `/giving-courses/activity/${obj.id}`, obj, sucBack, errBack)
}
// 立即结束赠课
export function stopGivingCourses(id, obj, sucBack, errBack) {
  pubRequire('put', `/giving-courses/${id}/end`, obj, sucBack, errBack)
}
// 赠课活动领取记录
export function getRecordsList(id, obj, sucBack, errBack) {
  pubRequire('get', `/giving-courses/${id}/records`, obj, sucBack, errBack)
}
// 根据活动id删除赠课活动
export function deleteGivingCourses(id, obj, sucBack, errBack) {
  pubRequire('delete', `/giving-courses/${id}`, obj, sucBack, errBack)
}
// 根据活动id查询赠课活动详情
export function getGivingCoursesDetail(id, obj, sucBack, errBack) {
  pubRequire('get', `/giving-courses/${id}`, obj, sucBack, errBack)
}
// 赠课活动统计
export function getGivingCoursesStatistics(id, obj, sucBack, errBack) {
  pubRequire('get', `/giving-courses/${id}/statistics`, obj, sucBack, errBack)
}
// 启用活动
export function startGivingCourses(id, obj, sucBack, errBack) {
  pubRequire('put', `/giving-courses/${id}/enabled`, obj, sucBack, errBack)
}
// 根据活动id修改活动配置结束时间
export function editActiveEndTime(id, obj, sucBack, errBack) {
  pubRequire('put', `/giving-courses/${id}`, obj, sucBack, errBack)
}
// 导入赠课用户
export function importUser() {
  return '/giving-courses/users/binding'
}
// 用户导入模板下载
export function downTemplate() {
  return '/activities/prize/download/dp-account'
}
// 选择用户分组组件列表
export function getGroupUserList(obj, sucBack, errBack) {
  pubRequire('get', '/user-group/component-list/', obj, sucBack, errBack)
}
